Change in openvpn[master]: Inlined credentials: read missing password from management interface
A message that is not in the archive (sent off-list or not yet received): gerrit.1774983232000.Ieeb2f980330d485739dbf3d722f107c1dbf704fc@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email
to review the following change.
Change subject: Inlined credentials: read missing password from management interface
......................................................................
Inlined credentials: read missing password from management interface
When commit 39619b7fab added support for inlining username only, fallback for password was from console. This is not ideal when graphical UI is in use as there is no console. Instead, query the management interface when possible.
This patch just extends a similar fix when username is read from a file and password is missing. As before, any username read from file or inlined is not peserved as we currently have no way of locking the username in the management interface prompt.
---
M src/openvpn/misc.c
1 file changed, 17 insertions(+), 19 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/1599/1
src/openvpn/misc.c +17 -19
@@ -305,24 +305,6 @@ {strncpy (up->password, password_buf,USER_PASS_LEN ); } -/* The auth-file does not have the password: get both username -* and password from the management interface if possible. -* Otherwise set to read password from console. -*/ -#if defined(ENABLE_MANAGEMENT ) - else if (management && (flags & GET_USER_PASS_MANAGEMENT) - && management_query_user_pass_enabled(management)) - { -msg (D_LOW , -"No password found in %s authfile '%s'. Querying the management interface" , - prefix, auth_file); -if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) - { -fclose (fp); -return false; - } - } -#endif else { password_from_stdin =1 ;
@@ -348,7 +330,23 @@if (username_from_stdin || password_from_stdin || response_from_stdin) {#ifdef ENABLE_MANAGEMENT -if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) +/* If management-query-passwords is true, we could be here because +* of no password present in auth-file or inline. In that case +* query via the management interface instead of stdin/console. +*/ +if (management && (flags &GET_USER_PASS_MANAGEMENT ) + &&management_query_user_pass_enabled (management) + && !(flags &GET_USER_PASS_USERNAME_ONLY )) + { +msg (D_LOW , +"No '%s' password found in authfile or inline. Querying the management interface" , + prefix); +if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) + { +return false; + } + } +else if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) {struct auth_challenge_info *ac =parse_auth_challenge (auth_challenge, &gc);if (ac)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ieeb2f980330d485739dbf3d722f107c1dbf704fc
Gerrit-Change-Number: 1599
Gerrit-PatchSet: 1
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Attention is currently required from: ordex, selvanair.
plaisthos has posted comments on this change by selvanair. ( http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email )
Change subject: Inlined credentials: read missing password from management interface
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ieeb2f980330d485739dbf3d722f107c1dbf704fc
Gerrit-Change-Number: 1599
Gerrit-PatchSet: 1
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Attention: selvanair <[email protected]...>
Gerrit-Comment-Date: Mon, 13 Apr 2026 21:34:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH 1/1 Inlined credentials: read missing password from management interface
In reply to a message not in the archiveFrom: Selva Nair <[email protected]...>
When commit 39619b7fab added support for inlining username only, fallback for password was from console. This is not ideal when graphical UI is in use as there is no console. Instead, query the management interface when possible.
This patch just extends a similar fix when username is read from a file and password is missing. As before, any username read from file or inlined is not peserved as we currently have no way of locking the username in the management interface prompt.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>
src/openvpn/misc.c +17 -19
@@ -305,24 +305,6 @@ {strncpy (up->password, password_buf,USER_PASS_LEN ); } -/* The auth-file does not have the password: get both username -* and password from the management interface if possible. -* Otherwise set to read password from console. -*/ -#if defined(ENABLE_MANAGEMENT ) - else if (management && (flags & GET_USER_PASS_MANAGEMENT) - && management_query_user_pass_enabled(management)) - { -msg (D_LOW , -"No password found in %s authfile '%s'. Querying the management interface" , - prefix, auth_file); -if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) - { -fclose (fp); -return false; - } - } -#endif else { password_from_stdin =1 ;
@@ -348,7 +330,23 @@if (username_from_stdin || password_from_stdin || response_from_stdin) {#ifdef ENABLE_MANAGEMENT -if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) +/* If management-query-passwords is true, we could be here because +* of no password present in auth-file or inline. In that case +* query via the management interface instead of stdin/console. +*/ +if (management && (flags &GET_USER_PASS_MANAGEMENT ) + &&management_query_user_pass_enabled (management) + && !(flags &GET_USER_PASS_USERNAME_ONLY )) + { +msg (D_LOW , +"No '%s' password found in authfile or inline. Querying the management interface" , + prefix); +if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) + { +return false; + } + } +else if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) {struct auth_challenge_info *ac =parse_auth_challenge (auth_challenge, &gc);if (ac)
[Openvpn-devel] [PATCH applied] Re: Inlined credentials: read missing password from management interface
The original commit looked so simple and straightforward, but these user-password-things never are... so thanks for fixing that omission. I have not tested it, but if Arne ACKs it - and the code looks more logical now, just using "password_from_stdin" as an indicator, not multiple nested variants.
I'm not sure if this could be considered a "bug", but it's definitely irritating behaviour for GUI users ("no credentials in file" leads to "both are queried from mgmt" while "username inlined" leads to "password queried from console only") so for a low minor version number, this definitely qualified as "we want to fix this in the current release".
Your patch has been applied to the master and release/2.7 branch.
commit 287acce1acaad25a92f2112e967b9686418ef72a (master) commit b450414d10309575c28ce00f175e8374e0e99480 (release/2.7)
Author: Selva Nair Date: Tue Apr 14 07:58:54 2026 +0200
Inlined credentials: read missing password from management interface
Signed-off-by: Selva Nair <[email protected]...>
Acked-by: Arne Schwabe <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36608.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by selvanair. ( http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by plaisthos
Change subject: Inlined credentials: read missing password from management interface
......................................................................
Inlined credentials: read missing password from management interface
When commit 39619b7fab added support for inlining username only, fallback for password was from console. This is not ideal when graphical UI is in use as there is no console. Instead, query the management interface when possible.
This patch just extends a similar fix when username is read from a file and password is missing. As before, any username read from file or inlined is not peserved as we currently have no way of locking the username in the management interface prompt.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36608.html
---
M src/openvpn/misc.c
1 file changed, 17 insertions(+), 19 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/99/1599/2
src/openvpn/misc.c +17 -19
@@ -305,24 +305,6 @@ {strncpy (up->password, password_buf,USER_PASS_LEN ); } -/* The auth-file does not have the password: get both username -* and password from the management interface if possible. -* Otherwise set to read password from console. -*/ -#if defined(ENABLE_MANAGEMENT ) - else if (management && (flags & GET_USER_PASS_MANAGEMENT) - && management_query_user_pass_enabled(management)) - { -msg (D_LOW , -"No password found in %s authfile '%s'. Querying the management interface" , - prefix, auth_file); -if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) - { -fclose (fp); -return false; - } - } -#endif else { password_from_stdin =1 ;
@@ -348,7 +330,23 @@if (username_from_stdin || password_from_stdin || response_from_stdin) {#ifdef ENABLE_MANAGEMENT -if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) +/* If management-query-passwords is true, we could be here because +* of no password present in auth-file or inline. In that case +* query via the management interface instead of stdin/console. +*/ +if (management && (flags &GET_USER_PASS_MANAGEMENT ) + &&management_query_user_pass_enabled (management) + && !(flags &GET_USER_PASS_USERNAME_ONLY )) + { +msg (D_LOW , +"No '%s' password found in authfile or inline. Querying the management interface" , + prefix); +if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) + { +return false; + } + } +else if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) {struct auth_challenge_info *ac =parse_auth_challenge (auth_challenge, &gc);if (ac)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ieeb2f980330d485739dbf3d722f107c1dbf704fc
Gerrit-Change-Number: 1599
Gerrit-PatchSet: 2
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email )
Change subject: Inlined credentials: read missing password from management interface
......................................................................
Inlined credentials: read missing password from management interface
When commit 39619b7fab added support for inlining username only, fallback for password was from console. This is not ideal when graphical UI is in use as there is no console. Instead, query the management interface when possible.
This patch just extends a similar fix when username is read from a file and password is missing. As before, any username read from file or inlined is not peserved as we currently have no way of locking the username in the management interface prompt.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1599
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36608.html
---
M src/openvpn/misc.c
1 file changed, 17 insertions(+), 19 deletions(-)
src/openvpn/misc.c +17 -19
@@ -305,24 +305,6 @@ {strncpy (up->password, password_buf,USER_PASS_LEN ); } -/* The auth-file does not have the password: get both username -* and password from the management interface if possible. -* Otherwise set to read password from console. -*/ -#if defined(ENABLE_MANAGEMENT ) - else if (management && (flags & GET_USER_PASS_MANAGEMENT) - && management_query_user_pass_enabled(management)) - { -msg (D_LOW , -"No password found in %s authfile '%s'. Querying the management interface" , - prefix, auth_file); -if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) - { -fclose (fp); -return false; - } - } -#endif else { password_from_stdin =1 ;
@@ -348,7 +330,23 @@if (username_from_stdin || password_from_stdin || response_from_stdin) {#ifdef ENABLE_MANAGEMENT -if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) +/* If management-query-passwords is true, we could be here because +* of no password present in auth-file or inline. In that case +* query via the management interface instead of stdin/console. +*/ +if (management && (flags &GET_USER_PASS_MANAGEMENT ) + &&management_query_user_pass_enabled (management) + && !(flags &GET_USER_PASS_USERNAME_ONLY )) + { +msg (D_LOW , +"No '%s' password found in authfile or inline. Querying the management interface" , + prefix); +if (!auth_user_pass_mgmt (up, prefix, flags, auth_challenge)) + { +return false; + } + } +else if (auth_challenge && (flags &GET_USER_PASS_DYNAMIC_CHALLENGE ) && response_from_stdin) {struct auth_challenge_info *ac =parse_auth_challenge (auth_challenge, &gc);if (ac)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1599?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ieeb2f980330d485739dbf3d722f107c1dbf704fc
Gerrit-Change-Number: 1599
Gerrit-PatchSet: 2
Gerrit-Owner: selvanair <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>